package team.sun.sss.dao.staff;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import team.sun.sss.pojo.staff.StaffReward;

import java.util.List;

@Mapper
@Repository
public interface StaffRewardDao {


    @Select("select * from staff_reward")
    List<StaffReward> getStaffReward();

    @Select("select * from staff_reward where sta_num=#{staNum}")
    List<StaffReward> getStaffRewardById(String staNum);

    @Delete("delete from staff_reward where reward_id=#{rewardId}")
    int deleteStaffReward(int rewardId);

    @Insert("insert into staff_reward(reward_name,reward_time,reward_unit,sta_num) values(#{rewardName},#{rewardTime},#{rewardUnit},#{staNum})")
    int addStaffReward(StaffReward staffReward);

    @Update("update staff_reward set reward_name=#{rewardName},reward_time=#{rewardTime},reward_unit=#{rewardUnit},sta_num=#{staNum} where reward_id=#{rewardId}")
    int updateStaffReward(StaffReward staffReward);
}
